﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// NotReviewedButNeeded
#pragma once

#include "GcmpDatabase.h"
#include "ICloneBehavior.h"

namespace gcmp
{
    class NdbObject;
    class IDbObject;

    // Ndb默认的序列化功能提供者
    class GCMP_DATABASE_EXPORT NdbCloneBehavior : public ICloneBehavior
    {
        DEFINE_CAST_DERIVED(NdbCloneBehavior, ICloneBehavior)
    public:
        static ICloneBehavior * Get(const NdbObject * pObject);

        virtual ~NdbCloneBehavior(void) {}

    public:
        virtual gcmp::OwnerPtr<IDbObject> CloneObject(void) override;

    private:
        NdbCloneBehavior() {}

        NdbCloneBehavior(const NdbObject * pObject) : m_pObject(pObject) {}

        void SetNdbObject(const NdbObject * pObject);

        const NdbObject * m_pObject;
    };
}

